
import request from '@/utils/request'

const customerApi = {
    createServices: '/v1/labor/company/create', // 劳务创建客户
    updateServices: '/v1/labor/company/update', // 修改劳务公司信息
    queryServicesList: '/v1/labor/company/list', // 劳务公司页表
    queryServicesDetail: '/v1/labor/company/detail/', // 获取单个劳务公司详情
    updateServicesState: '/v1/labor/company/state/update', // 劳务公司状态切换
    queryCustomerList: '/v1/customer/info/platform/page/list', // 获取所有甲方客户列表
    updateCustomerState: '/v1/customer/info/platform/state/change', // 切换甲方客户状态
    companyRelatedIndustrial: '/v1/labor/company/related/industrialPark', // 劳务公司关联园区
}

// 劳务创建客户
export function createServices (parameter) {
    return request({
        url: customerApi.createServices,
        method: 'post',
        data: parameter
    })
}

// 修改劳务公司信息
export function updateServices (parameter) {
    return request({
        url: customerApi.updateServices,
        method: 'post',
        data: parameter
    })
}

// 劳务公司列表
export function queryServicesList (parameter) {
    return request({
        url: customerApi.queryServicesList,
        method: 'get',
        params: parameter
    })
}

// 获取单个劳务公司详情
export function queryServicesDetail (laborCompanyId) {
    return request({
        url: `${customerApi.queryServicesDetail}/${laborCompanyId}`,
        method: 'get',
        params: {}
    })
}

// 劳务公司状态切换
export function updateServicesState (parameter) {
    return request({
        url: customerApi.updateServicesState,
        method: 'post',
        data: parameter
    })
}

// 获取甲方客户列表
export function queryCustomerList (parameter) {
    return request({
        url: customerApi.queryCustomerList,
        method: 'get',
        params: parameter
    })
}

// 甲方客户状态切换
export function updateCustomerState (parameter) {
    return request({
        url: customerApi.updateCustomerState,
        method: 'post',
        data: parameter
    })
}

// 劳务公司关联园区
export function companyRelatedIndustrial (parameter) {
    return request({
        url: customerApi.companyRelatedIndustrial,
        method: 'post',
        data: parameter
    })
}